<!--#include file="./doctype.html"-->
<title>文章管理-<%=siteTitle%>-后台管理</title>
</head><body>
<div class="wrap">
    <ol class="breadcrumb">
        <li class="active"><a href="<%=fileName%>">列表首页</a></li>
    </ol>
    <form method="get" action="<%=fileName%>" class="mb10" role="form">
        <input type="hidden" value="index" name="q">
        <div class="form-group">
            <label class="inline control-label" for="genreID">大类选择</label>
            <div class="inline w20 genre_id" data-name="genreID" data-id="<%=genreID%>"></div>
        </div>
        <div class="form-group">
            <label class="inline control-label" for="classID">栏目筛选</label>
            <div class="inline w20 class_id" data-name="classID" data-id="<%=classID%>"></div>
        </div>
        <div class="form-group">
            <label for="keyword">搜索标题、内容：</label>
            <input type="text" class="form-control inline w20 input-sm clean" id="keyword" name="keyword" value="<%=app.hec(keyword)%>" placeholder="标题、内容关键字">
            <button type="submit" class="btn btn-sm btn-primary">确定</button>
        </div>
    </form>
    <% if isArray(data) then %>
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>id</th>
                    <th>主图</th>
                    <th>所属栏目</th>
                    <th>标题</th>
                    <th>更新时间</th>
                    <th>点击</th>
                    <th>审核</th>
                    <th>置顶</th>
                    <th>浏览</th>
                </tr>
            </thead>
            <tbody>
            <% for i = 0 to ubound(data, 2)
                Tid = data(0,i)
                className = ""
                dim classInfo
                classInfo = app.getClassInfo(data(7,i))
                if isArray(classInfo) then className = classInfo(2)
                %>
                <tr>
                    <td><label><input type="checkbox" name="batchId" value="<%=Tid%>" /> <%=Tid%></label></td>
                    <td><img class="img-thumbnail show_pic thumb_img" src="<%=app.getInfoPic(data(1,i))%>"></td>
                    <td><a href="./class.asp?q=edit&id=<%=data(7,i)%>"><%=className%></a></td>
                    <td><a href="<%=fileName%>?q=edit&id=<%=Tid%>"><%=left(data(2,i),20)%></a></td>
                    <td><%=data(3,i)%></td>
                    <td><%=data(4,i)%></td>
                    <td class="setBool" data-value="<%=data(5,i)%>"></td>
                    <td class="setBool" data-value="<%=data(6,i)%>"></td>
                    <td><a target="_blank" href="<%=app.getInfoUrl(3,Tid,1)%>">浏览</a></td>
                </tr>
            <% next %>
            </tbody>
        </table>
        <!--#include file="page.html"-->
        <div class="btn-group">
            <span class="btn btn-sm btn-default selectAll">
                <i class="glyphicon glyphicon-th"></i> 全选/反选
            </span>
            <span class="btn btn-sm btn-default deleteBatch">
                <i class="glyphicon glyphicon-trash"></i> 删除
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="1" data-name="auditing">
                <i class="glyphicon glyphicon-ok"></i> 审核
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="0" data-name="auditing">
                <i class="glyphicon glyphicon-minus-sign"></i> 取消审核
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="1" data-name="isTop">
                <i class="glyphicon glyphicon-arrow-up"></i> 置顶
            </span>
            <span class="btn btn-sm btn-default statusBatch" data-status="0" data-name="isTop">
                <i class="glyphicon glyphicon-arrow-down"></i> 取消置顶
            </span>
            <span class="btn btn-sm btn-default editBatch">
                <i class="glyphicon glyphicon-edit"></i> 修改
            </span>
        </div>
    <% else %>
        <!--#include file="noData.html"-->
    <% End if %>
    <!--#include file="loadTime.html"-->
</div>
<script>
$(document).ready(function(){
    var getData = function(id) {
        var gid = id || $('#genreID').val();
        $('.class_id').getKind({
            url: './ajax.asp?q=getGenreClass',
            data: 'id='+gid
        });
    };
    $('.genre_id').getKind({
        url: './ajax.asp?q=getGenreType',
        data: 'id=3',
        type: 'select',
        callback: function(a) {
            getData($(this).find('select').val())
        }
    });
    $('.setBool').setBool(1);
$(this)
    .on('change', '.genre_id select', function() {
        getData($(this).val());
    })
    .on('click', '.statusBatch', function() {
        $(this).statusBatch();
    })
    .on('click', '.deleteBatch', function() {
        $.deleteBatch();
    })
    .on('click', '.editBatch', function() {
        $.editBatch();
    })
});
</script>
</body>
</html>